package com.cbn.ibcp.web.smp.enums;

public enum YesOrNoEnum implements BaseEnum<String> {

    YES(1, "是"),
    NO(0, "否");

    Integer value;
    String msg;

    YesOrNoEnum(Integer value, String msg) {
        this.value = value;
        this.msg = msg;
    }

    @Override
    public Integer getV() {
        return value;
    }

    public Long getLV() {
        return Long.valueOf(value);
    }

    @Override
    public boolean eqV(Object o) {
        if (this.value.equals(o)) {
            return true;
        }
        return false;
    }

    @Override
    public String getMessage() {
        return msg;
    }

    public static YesOrNoEnum getEnumByCode(Integer value) {
        for (YesOrNoEnum ut : values()) {
            if (ut.getV().equals(value)) {
                return ut;
            }
        }
        return null;
    }


}
